home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / phigs / ptk.lha / ptk / source / library / plusfns.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-01  |  60.9 KB  |  2,240 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*------------------- phinter PHIGS PLUS functions -------------------------*/
  3. /*--------------------------------------------------------------------------*/
  4.  
  5. static void do_pcellarray3plus()
  6. {
  7. #ifdef SUN
  8.   Pparal paral;
  9.   Pint_size dim;
  10.   Pint colour_model, i;
  11.   Pcoval *colrs;
  12.  
  13.   paral.p = readpoint3("parallelogram, point p");  
  14.   paral.q = readpoint3("parallelogram, point q");  
  15.   paral.r = readpoint3("parallelogram, point r");
  16.   dim.size_x = readinteger("number of cell divisions, x ? ");  
  17.   dim.size_y = readinteger("number of cell divisions, y ? ");
  18.   colour_model = readinteger("colour model ? ");
  19.   colrs = (Pcoval *)calloc(dim.size_x * dim.size_y, sizeof(Pcoval));
  20.   readcovalarray(colour_model, dim.size_x * dim.size_y, colrs);
  21.   pcell_array3_plus(¶l, &dim, colour_model, colrs);
  22.   free(colrs);
  23. #endif
  24. }  /* do_pcellarray3plus */
  25.  
  26. /*------------------------------------------------------------------------*/
  27.  
  28. static void do_pcompfillareasetgnorm()
  29. {
  30. #ifdef SUN
  31.   Pint vflag, nfa, err, i;
  32.   Pfacet_vdata_list3 *vdata;
  33.   Pvec3 normal;
  34.  
  35.   vflag = readinteger("vertex data flag ? ");
  36.   nfa = readinteger("number of fill areas ? ");
  37.   readfacetvdatalist3(vflag, colourmodel, nfa, vdata);
  38.   pcomp_fill_area_set_gnorm(vflag, nfa, vdata, &err, &normal);
  39.   if (writeinform)
  40.   {
  41.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  42.     if (err == 0)
  43.     {
  44.       phinprintf(PTKEINFORM, "geometric normal:\n");
  45.       writevector3(PTKEINFORM, &normal);
  46.     }
  47.     else
  48.       phigserror(PTKEINFORM, err);
  49.   }  
  50.   for (i = 0; i < nfa; i++)
  51.     free(vdata[i].vertex_data);
  52.   free(vdata);
  53. #endif
  54. }  /* do_pcompfillareasetgnorm */
  55.  
  56. /*------------------------------------------------------------------------*/
  57.  
  58. static void do_pfillareasetdata()
  59. {
  60. #ifdef SUN
  61.   phintererror(1, (char *)NULL, INFORM);
  62. #endif
  63. }  /* do_pfillareasetdata */
  64.  
  65. /*------------------------------------------------------------------------*/
  66.  
  67. static void do_pfillareaset3data()
  68. {
  69. #ifdef SUN
  70.   Pint fflag, eflag, vflag, colour_model, nfa, i;
  71.   Pfacet_data3 fdata;
  72.   Pedge_data_list *edata;
  73.   Pfacet_vdata_list3 *vdata;
  74.  
  75.   fflag = readinteger("facet data flag ? ");
  76.   eflag = readinteger("edge data flag ? ");
  77.   vflag = readinteger("vertex data flag ? ");
  78.   colour_model = readinteger("colour model ? ");
  79.   readfacetdata3(fflag, colour_model, &fdata);
  80.   nfa = readinteger("number of fill areas ? ");
  81.   if (eflag == PEDGE_VISIBILITY)
  82.     readedgedatalist(eflag, nfa, edata);
  83.   vdata = (Pfacet_vdata_list3 *)calloc(nfa, sizeof(Pfacet_vdata_list3));
  84.   for (i = 0; i < nfa; i++)
  85.     readfacetvdatalist3(vflag, colour_model, i, &vdata[i]);
  86.   pfill_area_set3_data(fflag, eflag, vflag, colour_model,
  87.                        &fdata, nfa, edata, vdata);
  88.   for (i = 0; i < nfa; i++)
  89.   {
  90.     switch (vflag)
  91.     {
  92.       case PVERT_COORD:
  93.         free(vdata[i].vertex_data.points);
  94.         break;
  95.  
  96.       case PVERT_COORD_COLOUR:
  97.         free(vdata[i].vertex_data.ptcolrs);
  98.         break;
  99.  
  100.       case PVERT_COORD_NORMAL:
  101.         free(vdata[i].vertex_data.ptnorms);
  102.         break;
  103.  
  104.       case PVERT_COORD_COLOUR_NORMAL:
  105.         free(vdata[i].vertex_data.ptconorms);
  106.         break;
  107.     }
  108.     if (eflag == PEDGE_VISIBILITY)
  109.       free(edata[i].edgedata.edges);
  110.   }
  111.   free(vdata);  
  112.   free(edata);
  113. #endif
  114. }  /* do_pfillareaset3data */
  115.  
  116. /*------------------------------------------------------------------------*/
  117.  
  118. static void do_pinqcolrmapfacs()
  119. {
  120. #ifdef SUN
  121.   Pint type, length, start, err, totlen;
  122.   Pcolr_map_facs facs;
  123.  
  124.   readwstype(&type);
  125.   start = readinteger("starting position in list ? ");
  126.   pinq_colr_map_facs(type, 0, start, &err, &facs, &totlen);
  127.   facs.meths.ints = (Pint *)calloc(totlen, sizeof(Pint));
  128.   pinq_colr_map_facs(type, totlen, start, &err, &facs, &totlen);
  129.   if (writeinform)
  130.   {
  131.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  132.     if (err == 0)
  133.     {
  134.       phinprintf(PTKEINFORM, "available colour mapping methods:\n");
  135.       phinprintf(PTKEINFORM, "number = ");
  136.       writeintlst(PTKEINFORM, &facs.meths, PTKENOTABLE);
  137.       phinprintf("number of predefined indicies = %d\n", facs.num_pred_inds);
  138.     }
  139.     else
  140.       phigserror(PTKEINFORM, err);
  141.   }
  142.   free(facs.meths.ints);
  143. #endif
  144. }  /* do_pinqcolrmapfacs */
  145.  
  146. /*------------------------------------------------------------------------*/
  147.  
  148. static void do_pinqcolrmapmethodfacs()
  149. {
  150. #ifdef SUN
  151.   Pint type, map_method, err;
  152.   Pcolr_map_st map_st;
  153.  
  154.   readwstype(&type);
  155.   map_method = readinteger("mapping method ? ");
  156.   pinq_colr_map_method_facs(type, map_method, &err, &map_st);
  157.   if (writeinform)
  158.   {
  159.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  160.     if (err == 0)
  161.     {
  162.       phinprintf(PTKEINFORM, "colour mapping method facilities:\n");
  163.       switch (map_method)
  164.       {
  165.         case PCOLR_MAP_TRUE:
  166.           phinprintf(PTKEINFORM, "number of available true colours = %d\n",
  167.                      map_st.int_data);
  168.           break;
  169.  
  170.         case PCOLR_MAP_PSEUDO:
  171.           phinprintf(PTKEINFORM, "number of available pseudo colours = %d\n",
  172.                      map_st.int_data);
  173.           break;
  174.  
  175.         case PCOLR_MAP_PSEUDO_N:
  176.           break;
  177.     }
  178.     }
  179.     else
  180.       phigserror(PTKEINFORM, err);
  181.   }
  182. #endif
  183. }  /* do_pinqcolrmapmethodfacs */
  184.  
  185. /*------------------------------------------------------------------------*/
  186.  
  187. static void do_pinqcolrmaprep()
  188. {
  189. #ifdef SUN
  190.   Pint ws, index, err, map_method, i;
  191.   Pinq_type type;
  192.   Pstore store;
  193.   Pcolr_map_data *map_data;
  194.  
  195.   ws = readinteger("workstation identifier ? ");
  196.   index = readinteger("colour mapping index ? ");
  197.   type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
  198.   pcreate_store(&err, &store);
  199.   pinq_colr_map_rep(ws, index, type, store, &err, &map_method,
  200.                     &map_data);
  201.   if (writeinform)
  202.   {
  203.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  204.     if (err == 0)
  205.     {
  206.       phinprintf(PTKEINFORM, "colour mapping method = %d\n", map_method);
  207.       switch (map_method)
  208.       {
  209.         case PCOLR_MAP_TRUE:
  210.           break;
  211.  
  212.         case PCOLR_MAP_PSEUDO:
  213.           phinprintf(PTKEINFORM, "colour model = %d\n", 
  214.                      map_data->meth_r2.colr_model);
  215.           phinprintf(PTKEINFORM, "weights:\n");
  216.           phinprintf(PTKEINFORM, "number = ");
  217.           writefloatlist(PTKEINFORM, &map_data->meth_r2.weights);
  218.           writecolreplist(PTKEINFORM, map_data->meth_r2.colr_model,
  219.                           &map_data->meth_r2.colrs);
  220.           break;
  221.  
  222.         case PCOLR_MAP_PSEUDO_N:
  223.           phinprintf(PTKEINFORM, "colour model = %d\n", 
  224.                      map_data->meth_r3.colr_model);
  225.           phinprintf(PTKEINFORM, "direct colours:\n");
  226.           phinprintf(PTKEINFORM, "number = ");
  227.           writeinteger(PTKEINFORM, map_data->meth_r3.colr_lists.num_lists);
  228.           for (i = 0; i < map_data->meth_r3.colr_lists.num_lists; i++)
  229.             writefloatlist(PTKEINFORM, 
  230.               &map_data->meth_r3.colr_lists.lists[i]);
  231.           break;
  232.  
  233.       }
  234.     }
  235.     else
  236.       phigserror(PTKEINFORM, err);
  237.   }
  238.   pdel_store(store);
  239. #endif
  240. }  /* do_pinqcolrmaprep */
  241.  
  242. /*------------------------------------------------------------------------*/
  243.  
  244. static void do_pinqcolrmapst()
  245. {
  246. #ifdef SUN
  247.   Pint ws, map_method, err;
  248.   Pcolr_map_st map_st;
  249.  
  250.   ws = readinteger("workstation identifier ? ");
  251.   map_method = readinteger("colour mapping method ? ");
  252.   pinq_colr_map_st(ws, map_method, &err, &map_st);
  253.   if (writeinform)
  254.   {
  255.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  256.     if (err == 0)
  257.     {
  258.       phinprintf(PTKEINFORM, "colour mapping state = %d\n",
  259.                  map_st.int_data);
  260.     }
  261.     else
  262.       phigserror(PTKEINFORM, err);
  263.   }
  264. #endif
  265. }  /* do_pinqcolrmapst */
  266.  
  267. /*------------------------------------------------------------------------*/
  268.  
  269. static void do_pinqcurvsurffacs()
  270. {
  271. #ifdef SUN
  272.   Pint type, cat_len, cat_st, sat_len, sat_st, tcat_len;
  273.   Pint tcat_st, psc_len, psc_st, err;
  274.   Pint tot_cat_len, tot_sat_len;
  275.   Pint tot_tcat_len, tot_psc_len;
  276.   Pcurvsurf_facs facil;
  277.  
  278.   readwstype(&type);
  279.   cat_st = readinteger("curve approx types, starting position ? ");
  280.   sat_st = readinteger("surface approx types, starting position ? ");
  281.   tcat_st = readinteger("trim curve approx types, starting position ? ");
  282.   psc_st = readinteger("param surface characs list, starting position ? ");
  283.   pinq_curv_surf_facs(type, 0, cat_st, 0, sat_st, 0, tcat_st,
  284.                       0, psc_st, &err, &facil, &tot_cat_len,
  285.                       &tot_sat_len, &tot_tcat_len, &tot_psc_len);
  286.   facil.cat_types.ints = (Pint *)calloc(tot_cat_len, sizeof(Pint));
  287.   facil.sat_types.ints = (Pint *)calloc(tot_sat_len, sizeof(Pint));
  288.   facil.tcat_types.ints = (Pint *)calloc(tot_tcat_len, sizeof(Pint));
  289.   facil.psc_types.ints = (Pint *)calloc(tot_psc_len, sizeof(Pint));
  290.   pinq_curv_surf_facs(type, tot_cat_len, cat_st, tot_sat_len, sat_st, 
  291.                       tot_tcat_len, tcat_st, tot_psc_len, psc_st, 
  292.                       &err, &facil, &tot_cat_len,
  293.                       &tot_sat_len, &tot_tcat_len, &tot_psc_len);
  294.   if (writeinform)
  295.   {
  296.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  297.     if (err == 0)
  298.     {
  299.       phinprintf(PTKEINFORM, "max B-spline order = %d\n",
  300.                  facil.max_bsp_order);
  301.       phinprintf(PTKEINFORM, "max trim curve order = %d\n",
  302.                  facil.max_tc_order);
  303.       phinprintf(PTKEINFORM, "curve approx types:\n");
  304.       phinprintf(PTKEINFORM, "number = ");
  305.       writeintlst(PTKEINFORM, &facil.cat_types, PTKENOTABLE);
  306.       phinprintf(PTKEINFORM, "surface approx types:\n");
  307.       phinprintf(PTKEINFORM, "number = ");
  308.       writeintlst(PTKEINFORM, &facil.sat_types, PTKENOTABLE);
  309.       phinprintf(PTKEINFORM, "trim curve approx types:\n");
  310.       phinprintf(PTKEINFORM, "number = ");
  311.       writeintlst(PTKEINFORM, &facil.tcat_types, PTKENOTABLE);
  312.       phinprintf(PTKEINFORM, "parametric surface characteristics:\n");
  313.       phinprintf(PTKEINFORM, "number = ");
  314.       writeintlst(PTKEINFORM, &facil.psc_types, PTKENOTABLE);
  315.     }
  316.     else
  317.       phigserror(PTKEINFORM, err);
  318.   }
  319.   free(facil.cat_types.ints);
  320.   free(facil.sat_types.ints);
  321.   free(facil.tcat_types.ints);
  322.   free(facil.psc_types.ints);
  323. #endif                      
  324. }  /* do_pinqcurvsurffacs */
  325.  
  326. /*------------------------------------------------------------------------*/
  327.  
  328. static void do_pinqdatamapfacs()
  329. {
  330. #ifdef SUN
  331.   phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  332.   phintererror(1, (char *)NULL, INFORM);
  333. #endif
  334. }  /* do_pinqdatamapfacs */
  335.  
  336. /*------------------------------------------------------------------------*/
  337.  
  338. static void do_pinqdatamaprep()
  339. {
  340. #ifdef SUN
  341.   phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  342.   phintererror(1, (char *)NULL, INFORM);
  343. #endif
  344. }  /* do_pinqdatamaprep */
  345.  
  346. /*------------------------------------------------------------------------*/
  347.  
  348. static void do_pinqdcuefacs()
  349. {
  350. #ifdef SUN
  351.   Pint type, err, facs;
  352.  
  353.   readwstype(&type);
  354.   pinq_dcue_facs(type, &err, &facs);
  355.   if (writeinform)
  356.   {
  357.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  358.     if (err == 0)
  359.     {
  360.       phinprintf(PTKEINFORM, "number of predefined depth cue indices = %d\n",
  361.                  facs);
  362.     }
  363.     else
  364.       phigserror(PTKEINFORM, err);
  365.   }
  366. #endif
  367. }  /* do_pinqdcuefacs */
  368.  
  369. /*------------------------------------------------------------------------*/
  370.  
  371. static void do_pinqdcuerep()
  372. {
  373. #ifdef SUN
  374.   Pint ws, index, err;
  375.   Pinq_type type;
  376.   Pdcue_bundle rep;
  377.  
  378.   ws = readinteger("workstation identifier ? ");
  379.   index = readinteger("depth cue index ? ");
  380.   type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
  381.   pinq_dcue_rep(ws, index, type, &err, &rep);
  382.   if (writeinform)
  383.   {
  384.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  385.     if (err == 0)
  386.     {
  387.       phinprintf(PTKEINFORM, "depth cue mode = ");
  388.       writephigsenum(PTKEINFORM, PTKEDCUEMODE, rep.mode);
  389.       phinprintf(PTKEINFORM, "back reference plane = %f\n", 
  390.                  rep.ref_planes[0]);
  391.       phinprintf(PTKEINFORM, "front reference plane = %f\n", 
  392.                  rep.ref_planes[1]);
  393.       phinprintf(PTKEINFORM, "back scaling = %f\n", 
  394.                  rep.scaling[0]);
  395.       phinprintf(PTKEINFORM, "front scaling = %f\n", 
  396.                  rep.scaling[1]);
  397.       phinprintf(PTKEINFORM, "depth cue colour:\n");
  398.       phinprintf(PTKEINFORM, "colour type = ");
  399.       writegcolr(PTKEINFORM, &rep.colr);      
  400.     }
  401.     else
  402.       phigserror(PTKEINFORM, err);
  403.   }
  404. #endif
  405. }  /* do_pinqdcuerep */
  406.  
  407. /*------------------------------------------------------------------------*/
  408.  
  409. static void do_pinqdirectcolrmodelfacs()
  410. {
  411. #ifdef SUN
  412.   Pint type, length, start, err, totlen;
  413.   Pint_list models;
  414.  
  415.   readwstype(&type);
  416.   start = readinteger("starting position ? ");
  417.   pinq_direct_colr_model_facs(type, 0, start, &err, &totlen, &models);
  418.   models.ints = (Pint *)calloc(totlen, sizeof(Pint));
  419.   pinq_direct_colr_model_facs(type, totlen, start, &err, &totlen, &models);
  420.   if (writeinform)
  421.   {
  422.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  423.     if (err == 0)
  424.     {
  425.       phinprintf(PTKEINFORM, "available colour models:\n");
  426.       phinprintf(PTKEINFORM, "number = ");
  427.       writeintlst(PTKEINFORM, &models, PTKENOTABLE);
  428.     }
  429.     else
  430.       phigserror(PTKEINFORM, err);
  431.   }
  432.   free(models.ints);
  433. #endif
  434. }  /* do_pinqdirectcolrmodelfacs */
  435.  
  436. /*------------------------------------------------------------------------*/
  437.  
  438. static void do_pinqdynswsattrsplus()
  439. {
  440. #ifdef SUN
  441.   Pint type, err;
  442.   Pdyns_ws_attrs_plus attr;
  443.  
  444.   readwstype(&type);
  445.   pinq_dyns_ws_attrs_plus(type, &err, &attr);
  446.   if (writeinform)
  447.   {
  448.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  449.     if (err == 0)
  450.     {
  451.       phinprintf(PTKEINFORM, "light source representation = ");
  452.       writephigsenum(PTKEINFORM, PTKEMODTYPE, attr.light_src_rep);
  453.       phinprintf(PTKEINFORM, "depth cue representation = ");
  454.       writephigsenum(PTKEINFORM, PTKEMODTYPE, attr.dcue_rep);
  455.       phinprintf(PTKEINFORM, "colour map representation = ");
  456.       writephigsenum(PTKEINFORM, PTKEMODTYPE, attr.colr_map_rep);
  457.     }
  458.     else
  459.       phigserror(PTKEINFORM, err);
  460.   }
  461. #endif
  462. }  /* do_pinqdynswsattrsplus */
  463.  
  464. /*------------------------------------------------------------------------*/
  465.  
  466. static void do_pinqedgerepplus()
  467. {
  468. #ifdef SUN
  469.   Pint ws, index, err;
  470.   Pinq_type type;
  471.   Pedge_bundle_plus rep;
  472.  
  473.   ws = readinteger("workstation identifier ? ");
  474.   index = readinteger("edge index ? ");
  475.   type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
  476.   pinq_edge_rep_plus(ws, index, type, &err, &rep);
  477.   if (writeinform)
  478.   {
  479.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  480.     if (err == 0)
  481.     {
  482.       phinprintf(PTKEINFORM, "edge representation plus:\n");
  483.       writeedgebundleplus(PTKEINFORM, &rep);
  484.     }
  485.     else
  486.       phigserror(PTKEINFORM, err);
  487.   }
  488. #endif
  489. }  /* do_pinqedgerepplus */
  490.  
  491. /*------------------------------------------------------------------------*/
  492.  
  493. static void do_pinqintfacsplus()
  494. {
  495. #ifdef SUN
  496.   Pint type, is_st, hs_st;
  497.   Pint re_st, sh_st, err;
  498.   Pint tot_is_len, tot_hs_len;
  499.   Pint tot_re_len, tot_sh_len;
  500.   Pint_facs_plus facil;
  501.  
  502.   readwstype(&type);
  503.   is_st = readinteger("interior styles, starting position ? ");
  504.   hs_st = readinteger("hatch styles, starting position ? ");
  505.   re_st = readinteger("reflectance models, starting position ? ");
  506.   sh_st = readinteger("shading methods, starting position ? ");
  507.   pinq_curv_surf_facs(type, 0, is_st, 0, hs_st, 0, re_st,
  508.                       0, sh_st, &err, &facil, &tot_is_len,
  509.                       &tot_hs_len, &tot_re_len, &tot_sh_len);
  510.   facil.int_styles = (Pint_style *)calloc(tot_is_len, sizeof(Pint_style));
  511.   facil.hatch_styles.ints = (Pint *)calloc(tot_hs_len, sizeof(Pint));
  512.   facil.refl_eqns.ints = (Pint *)calloc(tot_re_len, sizeof(Pint));
  513.   facil.shad_meths.ints = (Pint *)calloc(tot_sh_len, sizeof(Pint));
  514.   pinq_int_facs_plus(type, tot_is_len, is_st, tot_hs_len, hs_st, 
  515.                       tot_re_len, re_st, tot_sh_len, sh_st, 
  516.                       &err, &facil, &tot_is_len,
  517.                       &tot_hs_len, &tot_re_len, &tot_sh_len);
  518.   if (writeinform)
  519.   {
  520.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  521.     if (err == 0)
  522.     {
  523.       phinprintf(PTKEINFORM, "interior styles:\n");
  524.       writeenumlist(PTKEINFORM, PTKEINTERSTYLE, facil.num_int_styles, 
  525.                     facil.int_styles);
  526.       phinprintf(PTKEINFORM, "hatch styles:\n");
  527.       phinprintf(PTKEINFORM, "number = ");
  528.       writeintlst(PTKEINFORM, &facil.hatch_styles, PTKENOTABLE);
  529.       phinprintf(PTKEINFORM, "number of predefined interior bundles = ");
  530.       writeinteger(PTKEINFORM, facil.num_pred_inds);
  531.       phinprintf(PTKEINFORM, "reflectance models:\n");
  532.       phinprintf(PTKEINFORM, "number = ");
  533.       writeintlst(PTKEINFORM, &facil.refl_eqns, PTKENOTABLE);
  534.       phinprintf(PTKEINFORM, "shading methods:\n");
  535.       phinprintf(PTKEINFORM, "number = ");
  536.       writeintlst(PTKEINFORM, &facil.shad_meths, PTKENOTABLE);
  537.     }
  538.     else
  539.       phigserror(PTKEINFORM, err);
  540.   }
  541.   free(facil.int_styles);
  542.   free(facil.hatch_styles.ints);
  543.   free(facil.refl_eqns.ints);
  544.   free(facil.shad_meths.ints);
  545. #endif
  546. }  /* do_pinqintfacsplus */
  547.  
  548. /*------------------------------------------------------------------------*/
  549.  
  550. static void do_pinqintrepplus()
  551. {
  552. #ifdef SUN
  553.   Pint wsid, index, err;
  554.   Pinq_type type;
  555.   Pint_bundle_plus rep;
  556.  
  557.   wsid = readinteger("workstation identifier ? ");
  558.   index = readinteger("interior index ? ");
  559.   type = readphigsenum(PTKEINQTYPE, "type of value ? ");
  560.   pinq_int_rep_plus(wsid, index, type, &err, &rep);
  561.   if (writeinform)
  562.   {
  563.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  564.     if (err == 0)
  565.     {
  566.       phinprintf(PTKEINFORM, "interior representation:\n");
  567.       writeinterbundleplus(PTKEINFORM, &rep);
  568.     }
  569.     else
  570.       phigserror(PTKEINFORM, err);
  571.   }
  572. #endif
  573. }  /* do_pinqintrepplus */
  574.  
  575. /*------------------------------------------------------------------------*/
  576.  
  577. static void do_pinqlightsrcfacs()
  578. {
  579. #ifdef SUN
  580.   Pint type, start, err, totlen;
  581.   Plight_src_facs facs;
  582.  
  583.   readwstype(&type);
  584.   start = readinteger("starting position ? ");
  585.   pinq_light_src_facs(type, 0, start, &err, &facs, &totlen);
  586.   facs.types.ints = (Pint *)calloc(totlen, sizeof(Pint));
  587.   pinq_light_src_facs(type, 0, start, &err, &facs, &totlen);  
  588.   if (writeinform)
  589.   {
  590.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  591.     if (err == 0)
  592.     {
  593.       phinprintf(PTKEINFORM, "light source types:\n");
  594.       phinprintf(PTKEINFORM, "number = ");
  595.       writeintlst(PTKEINFORM, &facs.types, PTKENOTABLE);
  596.       phinprintf(PTKEINFORM, 
  597.          "max number of simultaneously active lights = %d\n", facs.max);
  598.       phinprintf(PTKEINFORM, "number of predefined light bundles = %d\n",
  599.                  facs.num_pred_inds);
  600.     }
  601.     else
  602.       phigserror(PTKEINFORM, err);
  603.   }
  604.   free(facs.types.ints);
  605. #endif
  606. }  /* do_pinqlightsrcfacs */
  607.  
  608. /*------------------------------------------------------------------------*/
  609.  
  610. static void do_pinqlightsrcrep()
  611. {
  612. #ifdef SUN
  613.   Pint ws, index, err;
  614.   Pinq_type type;
  615.   Plight_src_bundle rep;
  616.  
  617.   ws = readinteger("workstation identifier ? ");
  618.   index = readinteger("light source index ? ");
  619.   type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
  620.   pinq_light_src_rep(ws, index, type, &err, &rep);
  621.   if (writeinform)
  622.   {
  623.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  624.     if (err == 0)
  625.     {
  626.       writelightsrcbundle(PTKEINFORM, &rep);
  627.     }
  628.     else
  629.       phigserror(PTKEINFORM, err);
  630.   }
  631. #endif
  632. }  /* do_pinqlightsrcrep */
  633.  
  634. /*------------------------------------------------------------------------*/
  635.  
  636. static void do_pinqlistcolrmapinds()
  637. {
  638. #ifdef SUN
  639.   Pint ws, start, err, totlen;
  640.   Pint_list indices;
  641.  
  642.   ws = readinteger("workstation identifier ? ");
  643.   start = readinteger("starting position ? ");
  644.   pinq_list_colr_map_inds(ws, 0, start, &err, &indices, &totlen);
  645.   indices.ints = (Pint *)calloc(totlen, sizeof(Pint));
  646.   pinq_list_colr_map_inds(ws, totlen, start, &err, &indices, &totlen);
  647.   if (writeinform)
  648.   {
  649.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  650.     if (err == 0)
  651.     {
  652.       phinprintf(PTKEINFORM, "colour mapping indices:\n");
  653.       phinprintf(PTKEINFORM, "number = ");
  654.       writeintlst(PTKEINFORM, &indices, PTKENOTABLE);
  655.     }
  656.     else
  657.       phigserror(PTKEINFORM, err);
  658.   }
  659.   free(indices.ints);
  660. #endif
  661. }  /* do_pinqlistcolrmapinds */
  662.  
  663. /*------------------------------------------------------------------------*/
  664.  
  665. static void do_pinqlistdatamapinds()
  666. {
  667. #ifdef SUN
  668.   phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  669.   phintererror(1, (char *)NULL, INFORM);
  670. #endif
  671. }  /* do_pinqlistdatamapinds */
  672.  
  673. /*------------------------------------------------------------------------*/
  674.  
  675. static void do_pinqlistdcueinds()
  676. {
  677. #ifdef SUN
  678.   Pint ws, start, err, totlen;
  679.   Pint_list indices;
  680.  
  681.   ws = readinteger("workstation identifier ? ");
  682.   start = readinteger("starting position ? ");
  683.   pinq_list_dcue_inds(ws, 0, start, &err, &indices, &totlen);
  684.   indices.ints = (Pint *)calloc(totlen, sizeof(Pint));
  685.   pinq_list_dcue_inds(ws, totlen, start, &err, &indices, &totlen);
  686.   if (writeinform)
  687.   {
  688.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  689.     if (err == 0)
  690.     {
  691.       phinprintf(PTKEINFORM, "depth cue indices:\n");
  692.       phinprintf(PTKEINFORM, "number = ");
  693.       writeintlst(PTKEINFORM, &indices, PTKENOTABLE);
  694.     }
  695.     else
  696.       phigserror(PTKEINFORM, err);
  697.   }
  698.   free(indices.ints);
  699. #endif
  700. }  /* do_pinqlistdcueinds */
  701.  
  702. /*------------------------------------------------------------------------*/
  703.  
  704. static void do_pinqlistlightsrcinds()
  705. {
  706. #ifdef SUN
  707.   Pint ws, start, err, totlen;
  708.   Pint_list indices;
  709.  
  710.   ws = readinteger("workstation identifier ? ");
  711.   start = readinteger("starting position ? ");
  712.   pinq_list_light_src_inds(ws, 0, start, &err, &indices, &totlen);
  713.   indices.ints = (Pint *)calloc(totlen, sizeof(Pint));
  714.   pinq_list_light_src_inds(ws, totlen, start, &err, &indices, &totlen);
  715.   if (writeinform)
  716.   {
  717.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  718.     if (err == 0)
  719.     {
  720.       phinprintf(PTKEINFORM, "light source indices:\n");
  721.       phinprintf(PTKEINFORM, "number = ");
  722.       writeintlst(PTKEINFORM, &indices, PTKENOTABLE);
  723.     }
  724.     else
  725.       phigserror(PTKEINFORM, err);
  726.   }
  727.   free(indices.ints);
  728. #endif
  729. }  /* do_pinqlistlightsrcinds */
  730.  
  731. /*------------------------------------------------------------------------*/
  732.  
  733. static void do_pinqlistparamsurfinds()
  734. {
  735. #ifdef SUN
  736.   phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  737.   phintererror(1, (char *)NULL, INFORM);
  738. #endif
  739. }  /* do_pinqlistparamsurfinds */
  740.  
  741. /*------------------------------------------------------------------------*/
  742.  
  743. static void do_pinqlistreflinds()
  744. {
  745. #ifdef SUN
  746.   phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  747.   phintererror(1, (char *)NULL, INFORM);
  748. #endif
  749. }  /* do_pinqlistreflinds */
  750.  
  751. /*------------------------------------------------------------------------*/
  752.  
  753. static void do_pinqparamsurfrep()
  754. {
  755. #ifdef SUN
  756.   phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  757.   phintererror(1, (char *)NULL, INFORM);
  758. #endif
  759. }  /* do_pinqparamsurfrep */
  760.  
  761. /*------------------------------------------------------------------------*/
  762.  
  763. static void do_pinqpatrepplus()
  764. {
  765. #ifdef SUN
  766.   Pint wsid, index, err, numcols;
  767.   Pinq_type type;
  768.   Pstore store;
  769.   Ppat_rep_plus *rep;
  770.  
  771.   wsid = readinteger("workstation identifier ? ");
  772.   index = readinteger("pattern index ? ");
  773.   type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
  774.   pcreate_store(&err, &store);
  775.   pinq_pat_rep_plus(wsid, index, type, store, &err, &rep);
  776.   if (writeinform)
  777.   {
  778.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  779.     if (err == 0)
  780.     {
  781.       phinprintf(PTKEINFORM, "pattern representation:\n");
  782.       phinprintf(PTKEINFORM, "dimensions, x = %d, y = %d\n",
  783.               rep->dims.size_x, rep->dims.size_y);
  784.       phinprintf(PTKEINFORM, "colour type = %d\n", rep->type);
  785.       numcols = rep->dims.size_x * rep->dims.size_y;
  786.       phinprintf(PTKEINFORM, "colour grid:\n");
  787.       writecovalarray(PTKEINFORM, numcols, rep->colr_array);
  788.     }
  789.     else
  790.       phigserror(PTKEINFORM, err);
  791.   }
  792.   pdel_store(store);
  793. #endif
  794. }  /* do_pinqpatrepplus */
  795.  
  796. /*------------------------------------------------------------------------*/
  797.  
  798. static void do_pinqlinefacsplus()
  799. {
  800. #ifdef SUN
  801.   Pint wstype, lt_st, sm_st, tlt_len, tsm_len, err;
  802.   Pline_facs_plus facil;
  803.  
  804.   readwstype(&wstype);
  805.   lt_st = readinteger("curve approx types, starting position ? ");
  806.   sm_st = readinteger("surface approx types, starting position ? ");
  807.   pinq_line_facs_plus(wstype, 0, lt_st, 0, sm_st, &err, &facil, &tlt_len,
  808.                       &tsm_len);
  809.   facil.types.ints = (Pint *)calloc(tlt_len, sizeof(Pint));
  810.   facil.shads.ints = (Pint *)calloc(tsm_len, sizeof(Pint));
  811.   pinq_line_facs_plus(wstype, tlt_len, lt_st, tsm_len, sm_st, 
  812.                       &err, &facil, &tlt_len, &tsm_len);
  813.   if (writeinform)
  814.   {
  815.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  816.     if (err == 0)
  817.     {
  818.       phinprintf(PTKEINFORM, "line types:\n");
  819.       phinprintf(PTKEINFORM, "number = ");
  820.       writeintlst(PTKEINFORM, &facil.types, PTKENOTABLE);
  821.       phinprintf(PTKEINFORM, "number of available line widths = %d\n",
  822.                  facil.num_widths);
  823.       phinprintf(PTKEINFORM, "nominal line width = %f\n",
  824.                  facil.nom_width);
  825.       phinprintf(PTKEINFORM, "minimum line width = %f\n",
  826.                  facil.min_width);
  827.       phinprintf(PTKEINFORM, "maximum line width = %f\n",
  828.                  facil.max_width);
  829.       phinprintf(PTKEINFORM, "number of predefined bundles = %d\n",
  830.                  facil.num_pred_inds);
  831.       phinprintf(PTKEINFORM, "shading methods:\n");
  832.       phinprintf(PTKEINFORM, "number = ");
  833.       writeintlst(PTKEINFORM, &facil.shads, PTKENOTABLE);
  834.     }
  835.     else
  836.       phigserror(PTKEINFORM, err);
  837.   }
  838.   free(facil.types.ints);
  839.   free(facil.shads.ints);
  840. #endif
  841. }  /* do_pinqlinefacsplus */
  842.  
  843. /*------------------------------------------------------------------------*/
  844.  
  845. static void do_pinqlinerepplus()
  846. {
  847. #ifdef SUN
  848.   Pint wsid, index, err;
  849.   Pinq_type type;
  850.   Pline_bundle_plus rep;
  851.  
  852.   wsid = readinteger("workstation identifier ? ");
  853.   index = readinteger("line index ? ");
  854.   type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
  855.   pinq_line_rep_plus(wsid, index, type, &err, &rep);
  856.   if (writeinform)
  857.   {
  858.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  859.     if (err == 0)
  860.     {
  861.       phinprintf(PTKEINFORM, "line representation:\n");
  862.       writelinebundleplus(PTKEINFORM, &rep);
  863.     }
  864.     else
  865.       phigserror(PTKEINFORM, err);
  866.   }
  867. #endif
  868. }  /* do_pinqlinerepplus */
  869.  
  870. /*------------------------------------------------------------------------*/
  871.  
  872. static void do_pinqmarkerrepplus()
  873. {
  874. #ifdef SUN
  875.   Pint wsid, index, err;
  876.   Pinq_type type;
  877.   Pmarker_bundle_plus rep;
  878.  
  879.   wsid = readinteger("workstation identifier ? ");
  880.   index = readinteger("marker index ? ");
  881.   type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
  882.   pinq_marker_rep_plus(wsid, index, type, &err, &rep);
  883.   if (writeinform)
  884.   {
  885.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  886.     if (err == 0)
  887.     {
  888.       phinprintf(PTKEINFORM, "marker representation:\n");
  889.       writemarkerbundleplus(PTKEINFORM, &rep);
  890.     }
  891.     else
  892.       phigserror(PTKEINFORM, err);
  893.   }
  894. #endif
  895. }  /* do_pinqmarkerrepplus */
  896.  
  897. /*------------------------------------------------------------------------*/
  898.  
  899. static void do_pinqpredcolrmaprep()
  900. {
  901. #ifdef SUN
  902.   Pint ws_type, index, err, map_method, i;
  903.   Pstore store;
  904.   Pcolr_map_data *map_data;
  905.  
  906.   readwstype(&ws_type);
  907.   index = readinteger("colour map index ? ");
  908.   pcreate_store(&err, &store);
  909.   pinq_pred_colr_map_rep(ws_type, index, store, &err, &map_method,
  910.                          &map_data);
  911.   if (writeinform)
  912.   {
  913.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  914.     if (err == 0)
  915.     {
  916.       phinprintf(PTKEINFORM, "colour mapping representation:\n");
  917.       phinprintf(PTKEINFORM, "colour mapping method = %d\n", map_method);
  918.       switch (map_method)
  919.       {
  920.         case PCOLR_MAP_TRUE:
  921.           break;
  922.  
  923.         case PCOLR_MAP_PSEUDO:
  924.           phinprintf(PTKEINFORM, "colour model = %d\n", 
  925.                      map_data->meth_r2.colr_model);
  926.           phinprintf(PTKEINFORM, "weights:\n");
  927.           phinprintf(PTKEINFORM, "number = ");
  928.           writefloatlist(PTKEINFORM, &map_data->meth_r2.weights);
  929.           writecolreplist(PTKEINFORM, map_data->meth_r2.colr_model,
  930.                           &map_data->meth_r2.colrs);
  931.           break;
  932.  
  933.         case PCOLR_MAP_PSEUDO_N:
  934.           phinprintf(PTKEINFORM, "colour model = %d\n", 
  935.                      map_data->meth_r3.colr_model);
  936.           phinprintf(PTKEINFORM, "direct colours:\n");
  937.           phinprintf(PTKEINFORM, "number = ");
  938.           writeinteger(PTKEINFORM, map_data->meth_r3.colr_lists.num_lists);
  939.           for (i = 0; i < map_data->meth_r3.colr_lists.num_lists; i++)
  940.             writefloatlist(PTKEINFORM, 
  941.               &map_data->meth_r3.colr_lists.lists[i]);
  942.           break;
  943.  
  944.       }
  945.     }
  946.     else
  947.       phigserror(PTKEINFORM, err);
  948.   }
  949.   pdel_store(store);
  950. #endif
  951. }  /* do_pinqpredcolrmaprep */
  952.  
  953. /*------------------------------------------------------------------------*/
  954.  
  955. static void do_pinqpreddatamaprep()
  956. {
  957. #ifdef SUN
  958.   phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  959.   phintererror(1, (char *)NULL, INFORM);
  960. #endif
  961. }  /* do_pinqpreddatamaprep */
  962.  
  963. /*------------------------------------------------------------------------*/
  964.  
  965. static void do_pinqpreddcuerep()
  966. {
  967. #ifdef SUN
  968.   Pint wstype, index, err;
  969.   Pdcue_bundle rep;
  970.  
  971.   readwstype(&wstype);
  972.   index = readinteger("depth cue index ? ");
  973.   pinq_pred_dcue_rep(wstype, index, &err, &rep);
  974.   if (writeinform)
  975.   {
  976.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  977.     if (err == 0)
  978.     {
  979.       phinprintf(PTKEINFORM, "depth cue representation:\n");
  980.       phinprintf(PTKEINFORM, "depth cue mode = ");
  981.       writephigsenum(PTKEINFORM, PTKEDCUEMODE, rep.mode);
  982.       phinprintf(PTKEINFORM, "back reference plane = %f\n", 
  983.                  rep.ref_planes[0]);
  984.       phinprintf(PTKEINFORM, "front reference plane = %f\n", 
  985.                  rep.ref_planes[1]);
  986.       phinprintf(PTKEINFORM, "back scaling = %f\n", 
  987.                  rep.scaling[0]);
  988.       phinprintf(PTKEINFORM, "front scaling = %f\n", 
  989.                  rep.scaling[1]);
  990.       phinprintf(PTKEINFORM, "depth cue colour:\n");
  991.       phinprintf(PTKEINFORM, "colour type = ");
  992.       writegcolr(PTKEINFORM, &rep.colr);      
  993.     }
  994.     else
  995.       phigserror(PTKEINFORM, err);
  996.   }
  997. #endif
  998. }  /* do_pinqpreddcuerep */
  999.  
  1000. /*------------------------------------------------------------------------*/
  1001.  
  1002. static void do_pinqprededgerepplus()
  1003. {
  1004. #ifdef SUN
  1005.   Pint wstype, index, err;
  1006.   Pedge_bundle_plus rep;
  1007.  
  1008.   readwstype(&wstype);
  1009.   index = readinteger("edge index ? ");
  1010.   pinq_pred_edge_rep_plus(wstype, index, &err, &rep);
  1011.   if (writeinform)
  1012.   {
  1013.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1014.     if (err == 0)
  1015.     {
  1016.       phinprintf(PTKEINFORM, "edge representation plus:\n");
  1017.       writeedgebundleplus(PTKEINFORM, &rep);
  1018.     }
  1019.     else
  1020.       phigserror(PTKEINFORM, err);
  1021.   }
  1022. #endif
  1023. }  /* do_pinqprededgerepplus */
  1024.  
  1025. /*------------------------------------------------------------------------*/
  1026.  
  1027. static void do_pinqpredintrepplus()
  1028. {
  1029. #ifdef SUN
  1030.   Pint wstype, index, err;
  1031.   Pint_bundle_plus rep;
  1032.  
  1033.   readwstype(&wstype);
  1034.   pinq_pred_int_rep_plus(wstype, index, &err, &rep);
  1035.   if (writeinform)
  1036.   {
  1037.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1038.     if (err == 0)
  1039.     {
  1040.       phinprintf(PTKEINFORM, "interior representation:\n");
  1041.       writeinterbundleplus(PTKEINFORM, &rep);
  1042.     }
  1043.     else
  1044.       phigserror(PTKEINFORM, err);
  1045.   }
  1046. #endif
  1047. }  /* do_pinqpredintrepplus */
  1048.  
  1049. /*------------------------------------------------------------------------*/
  1050.  
  1051. static void do_pinqpredlightsrcrep()
  1052. {
  1053. #ifdef SUN
  1054.   Pint wstype, index, err;
  1055.   Plight_src_bundle rep;
  1056.  
  1057.   readwstype(&wstype);
  1058.   index = readinteger("light source index ? ");
  1059.   pinq_pred_light_src_rep(wstype, index, &err, &rep);
  1060.   if (writeinform)
  1061.   {
  1062.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1063.     if (err == 0)
  1064.     {
  1065.       writelightsrcbundle(PTKEINFORM, &rep);
  1066.     }
  1067.     else
  1068.       phigserror(PTKEINFORM, err);
  1069.   }
  1070. #endif
  1071. }  /* do_pinqpredlightsrcrep */
  1072.  
  1073. /*------------------------------------------------------------------------*/
  1074.  
  1075. static void do_pinqpredparamsurfrep()
  1076. {
  1077. #ifdef SUN
  1078.   phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1079.   phintererror(1, (char *)NULL, INFORM);
  1080. #endif
  1081. }  /* do_pinqpredparamsurfrep */
  1082.  
  1083. /*------------------------------------------------------------------------*/
  1084.  
  1085. static void do_pinqpredpatrepplus()
  1086. {
  1087. #ifdef SUN
  1088.   Pint wstype, index, err, numcols;
  1089.   Ppat_rep_plus rep;
  1090.   Pstore store;
  1091.  
  1092.   readwstype(&wstype);
  1093.   index = readinteger("pattern index ? ");
  1094.   pcreate_store(&err, &store);
  1095.   pinq_pred_pat_rep_plus(wstype, index, store, &err, &rep);
  1096.   if (writeinform)
  1097.   {
  1098.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1099.     if (err == 0)
  1100.     {
  1101.       phinprintf(PTKEINFORM, "pattern representation:\n");
  1102.       phinprintf(PTKEINFORM, "dimensions, x = %d, y = %d\n",
  1103.               rep.dims.size_x, rep.dims.size_y);
  1104.       phinprintf(PTKEINFORM, "colour type = %d\n", rep.type);
  1105.       numcols = rep.dims.size_x * rep.dims.size_y;
  1106.       phinprintf(PTKEINFORM, "colour grid:\n");
  1107.       writecovalarray(PTKEINFORM, numcols, rep.colr_array);
  1108.     }
  1109.     else
  1110.       phigserror(PTKEINFORM, err);
  1111.   }
  1112.   pdel_store(store);
  1113. #endif
  1114. }  /* do_pinqpredpatrepplus */
  1115.  
  1116. /*------------------------------------------------------------------------*/
  1117.  
  1118. static void do_pinqpredlinerepplus()
  1119. {
  1120. #ifdef SUN
  1121.   Pint wstype, index, err;
  1122.   Pline_bundle_plus rep;
  1123.  
  1124.   readwstype(&wstype);
  1125.   index = readinteger("line index ? ");
  1126.   pinq_pred_line_rep_plus(wstype, index, &err, &rep);
  1127.   if (writeinform)
  1128.   {
  1129.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1130.     if (err == 0)
  1131.     {
  1132.       phinprintf(PTKEINFORM, "line representation:\n");
  1133.       writelinebundleplus(PTKEINFORM, &rep);
  1134.     }
  1135.     else
  1136.       phigserror(PTKEINFORM, err);
  1137.   }
  1138. #endif
  1139. }  /* do_pinqpredlinerepplus */
  1140.  
  1141. /*------------------------------------------------------------------------*/
  1142.  
  1143. static void do_pinqpredmarkerrepplus()
  1144. {
  1145. #ifdef SUN
  1146.   Pint wstype, index, err;
  1147.   Pmarker_bundle_plus rep;
  1148.  
  1149.   readwstype(&wstype);
  1150.   index = readinteger("marker index ? ");
  1151.   pinq_pred_marker_rep_plus(wstype, index, &err, &rep);
  1152.   if (writeinform)
  1153.   {
  1154.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1155.     if (err == 0)
  1156.     {
  1157.       phinprintf(PTKEINFORM, "marker representation:\n");
  1158.       writemarkerbundleplus(PTKEINFORM, &rep);
  1159.     }
  1160.     else
  1161.       phigserror(PTKEINFORM, err);
  1162.   }
  1163. #endif
  1164. }  /* do_pinqpredmarkerrepplus */
  1165.  
  1166. /*------------------------------------------------------------------------*/
  1167.  
  1168. static void do_pinqpredreflrep()
  1169. {
  1170. #ifdef SUN
  1171.   phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1172.   phintererror(1, (char *)NULL, INFORM);
  1173. #endif
  1174. }  /* do_pinqpredreflrep */
  1175.  
  1176. /*------------------------------------------------------------------------*/
  1177.  
  1178. static void do_pinqpredtextrepplus()
  1179. {
  1180. #ifdef SUN
  1181.   Pint wstype, index, err;
  1182.   Ptext_bundle_plus rep;
  1183.  
  1184.   readwstype(&wstype);
  1185.   index = readinteger("text index ? ");
  1186.   pinq_pred_text_rep_plus(wstype, index, &err, &rep);
  1187.   if (writeinform)
  1188.   {
  1189.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1190.     if (err == 0)
  1191.     {
  1192.       phinprintf(PTKEINFORM, "text representation:\n");
  1193.       writetextbundleplus(PTKEINFORM, &rep);
  1194.     }
  1195.     else
  1196.       phigserror(PTKEINFORM, err);
  1197.   }
  1198. #endif
  1199. }  /* do_pinqpredtextrepplus */
  1200.  
  1201. /*------------------------------------------------------------------------*/
  1202.  
  1203. static void do_pinqreflfacs()
  1204. {
  1205. #ifdef SUN
  1206.   phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1207.   phintererror(1, (char *)NULL, INFORM);
  1208. #endif
  1209. }  /* do_pinqreflfacs */
  1210.  
  1211. /*------------------------------------------------------------------------*/
  1212.  
  1213. static void do_pinqreflrep()
  1214. {
  1215. #ifdef SUN
  1216.   phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1217.   phintererror(1, (char *)NULL, INFORM);
  1218. #endif
  1219. }  /* do_pinqreflrep */
  1220.  
  1221. /*------------------------------------------------------------------------*/
  1222.  
  1223. static void do_pinqrenderingcolrmodelfacs()
  1224. {
  1225. #ifdef SUN
  1226.   Pint type, start, err, totlen;
  1227.   Pint_list models;
  1228.  
  1229.   readwstype(&type);
  1230.   start = readinteger("starting position ? ");
  1231.   pinq_rendering_colr_model_facs(type, 0, start, &err, &models, &totlen);
  1232.   models.ints = (Pint *)calloc(totlen, sizeof(Pint));
  1233.   pinq_rendering_colr_model_facs(type, totlen, start, &err, &models, &totlen);
  1234.   if (writeinform)
  1235.   {
  1236.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1237.     if (err == 0)
  1238.     {
  1239.       phinprintf(PTKEINFORM, "rendering colour model facilities:\n");
  1240.       phinprintf(PTKEINFORM, "number = ");
  1241.       writeintlst(PTKEINFORM, &models, PTKENOTABLE);
  1242.     }
  1243.     else
  1244.       phigserror(PTKEINFORM, err);
  1245.   }
  1246. #endif
  1247. }  /* do_pinqrenderingcolrmodelfacs */
  1248.  
  1249. /*------------------------------------------------------------------------*/
  1250.  
  1251. static void do_pinqtextrepplus()
  1252. {
  1253. #ifdef SUN
  1254.   Pint ws, index, err;
  1255.   Pinq_type type;
  1256.   Ptext_bundle_plus rep;
  1257.  
  1258.   ws = readinteger("workstation identifier ? ");
  1259.   index = readinteger("text index ? ");
  1260.   type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
  1261.   pinq_text_rep_plus(ws, index, type, &err, &rep);
  1262.   if (writeinform)
  1263.   {
  1264.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1265.     if (err == 0)
  1266.     {
  1267.       phinprintf(PTKEINFORM, "text representation:\n");
  1268.       writetextbundleplus(PTKEINFORM, &rep);
  1269.     }
  1270.     else
  1271.       phigserror(PTKEINFORM, err);
  1272.   }
  1273. #endif
  1274. }  /* do_pinqtextrepplus */
  1275.  
  1276. /*------------------------------------------------------------------------*/
  1277.  
  1278. static void do_pinqwssttableplus()
  1279. {
  1280. #ifdef SUN
  1281.   Pint wstype;
  1282.   Pint err;
  1283.   Pws_tables_plus lengths;
  1284.  
  1285.   readwstype(&wstype);
  1286.   pinq_ws_st_table_plus(wstype, &err, &lengths);
  1287.   if (writeinform)
  1288.   {
  1289.     phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
  1290.     if (err == 0)
  1291.     {
  1292.       phinprintf(PTKEINFORM, "lengths of workstation state tables:\n");
  1293.       phinprintf(PTKEINFORM, "line = ");
  1294.       writeinteger(PTKEINFORM, lengths.line_bundles);
  1295.       phinprintf(PTKEINFORM, "marker = ");
  1296.       writeinteger(PTKEINFORM, lengths.mark_bundles);
  1297.       phinprintf(PTKEINFORM, "text = ");
  1298.       writeinteger(PTKEINFORM, lengths.text_bundles);
  1299.       phinprintf(PTKEINFORM, "interior = ");
  1300.       writeinteger(PTKEINFORM, lengths.int_bundles);
  1301.       phinprintf(PTKEINFORM, "edge = ");
  1302.       writeinteger(PTKEINFORM, lengths.edge_bundles);
  1303.       phinprintf(PTKEINFORM, "pattern = ");
  1304.       writeinteger(PTKEINFORM, lengths.pat_reps);
  1305.       phinprintf(PTKEINFORM, "colour = ");
  1306.       writeinteger(PTKEINFORM, lengths.colr_reps);
  1307.       phinprintf(PTKEINFORM, "view = ");
  1308.       writeinteger(PTKEINFORM, lengths.view_reps);
  1309.       phinprintf(PTKEINFORM, "depth cue = ");
  1310.       writeinteger(PTKEINFORM, lengths.dcue_rep);
  1311.       phinprintf(PTKEINFORM, "light source = ");
  1312.       writeinteger(PTKEINFORM, lengths.light_src_rep);
  1313.       phinprintf(PTKEINFORM, "colour mapping = ");
  1314.       writeinteger(PTKEINFORM, lengths.colr_map_rep);
  1315.     }
  1316.     else
  1317.       phigserror(PTKEINFORM, err);
  1318.   }
  1319. #endif
  1320. }  /* do_pinqwssttableplus */
  1321.  
  1322. /*------------------------------------------------------------------------*/
  1323.  
  1324. static void do_pnunibsplcurv()
  1325. {
  1326. #ifdef SUN
  1327.   Pint order;
  1328.   Pfloat_list knots;
  1329.   Prational rationality;
  1330.   Ppoint_list34    cpoints;
  1331.   Pfloat min, max; 
  1332.  
  1333.   order = readinteger("spline order ? ");
  1334.   readfloatlist(&knots, "knots");
  1335.   rationality = readphigsenum(PTKERATIONAL, "rationality ? ");
  1336.   readpointlist34(rationality, &cpoints, "control points ? ");
  1337.   min = readreal("curve range, minimum ? ");
  1338.   max = readreal("curve range, maximum ? ");
  1339.   pnuni_bsp_curv(order, &knots, rationality, &cpoints, min, max);
  1340.   free(knots.floats);
  1341.   if (rationality == PRATIONAL)
  1342.     free(cpoints.points.point4d);
  1343.   else
  1344.     free(cpoints.points.point3d);
  1345. #endif
  1346. }  /* do_pnunibsplcurv */
  1347.  
  1348. /*------------------------------------------------------------------------*/
  1349.  
  1350. static void do_pnunibsplcurvcolr()
  1351. {
  1352. #ifdef SUN
  1353.   phintererror(1, (char *)NULL, INFORM);
  1354. #endif
  1355. }  /* do_pnunibsplcurvcolr */
  1356.  
  1357. /*------------------------------------------------------------------------*/
  1358.  
  1359. static void do_pnunibsplsurf()
  1360. {
  1361. #ifdef SUN
  1362.   Pint uorder, vorder, nloops, i, j;
  1363.   Pfloat_list uknots, vknots;
  1364.   Prational rationality;
  1365.   Ppoint_grid34    grid;
  1366.   Ptrimcurve_list *tloops;
  1367.   char prom[80];
  1368.  
  1369.   uorder = readinteger("U spline order ? ");
  1370.   vorder = readinteger("V spline order ? ");
  1371.   readfloatlist(&uknots, "U knots");
  1372.   readfloatlist(&vknots, "V knots");
  1373.   rationality = readphigsenum(PTKERATIONAL, "rationality ? ");
  1374.   readpointgrid34(rationality, &grid, "control grid");
  1375.   nloops = readinteger("number of trim curve loops ? ");
  1376.   tloops = (Ptrimcurve_list *)calloc(nloops, sizeof(Ptrimcurve_list));
  1377.   for (i = 0; i < nloops; i++)
  1378.   {
  1379.     sprintf(prom, "trim curve loop [%d]", i);
  1380.     readtrimcurvelist(&tloops[i], prom);    
  1381.   }
  1382.   pnuni_bsp_surf(uorder, vorder, &uknots, &vknots, rationality, &grid, 
  1383.                  nloops, tloops);
  1384.   free(uknots.floats);
  1385.   free(vknots.floats);
  1386.   if (rationality == PRATIONAL)
  1387.     free(grid.points.point4d);
  1388.   else
  1389.     free(grid.points.point3d);
  1390.   for (i = 0; i < nloops; i++)
  1391.   {
  1392.     for (j = 0; j < tloops[i].num_curves; j++)
  1393.     {
  1394.       free(tloops[i].curves[j].knots.floats);
  1395.       if (tloops[i].curves[j].rationality == PRATIONAL)
  1396.         free(tloops[i].curves[j].cpts.points.point3d);
  1397.       else
  1398.         free(tloops[i].curves[j].cpts.points.point2d);
  1399.     }
  1400.     free(tloops[i].curves);
  1401.   }
  1402.   free(tloops);
  1403. #endif
  1404. }  /* do_pnunibsplsurf */
  1405.  
  1406. /*------------------------------------------------------------------------*/
  1407.  
  1408. static void do_pnunibsplsurfdata()
  1409. {
  1410. #ifdef SUN
  1411.   phintererror(1, (char *)NULL, INFORM);
  1412. #endif
  1413. }  /* do_pnunibsplsurfdata */
  1414.  
  1415. /*------------------------------------------------------------------------*/
  1416.  
  1417. static void do_ppolylineset3data()
  1418. {
  1419. #ifdef SUN
  1420.   Pint vflag, colour_model, npl, i;
  1421.   Pline_vdata_list3 *vdata;
  1422.  
  1423.   vflag = readinteger("vertex data flag ? ");
  1424.   colour_model = readinteger("colour model ? ");
  1425.   npl = readinteger("number of polylines ? ");
  1426.   vdata = (Pline_vdata_list3 *)calloc(npl, sizeof(Pline_vdata_list3));
  1427.   for (i = 0; i < npl; i++)
  1428.     readlinevdatalist3(vflag, colour_model, i, &vdata[i]);
  1429.   ppolyline_set3_data(vflag, colour_model, npl, vdata);
  1430.   for (i = 0; i < npl; i++)
  1431.   {
  1432.     switch (vflag)
  1433.     {
  1434.       case PVERT_COORD:
  1435.         free(vdata[i].vertex_data.points);
  1436.         break;
  1437.  
  1438.       case PVERT_COORD_COLOUR:
  1439.         free(vdata[i].vertex_data.ptcolrs);
  1440.         break;
  1441.     }
  1442.   }
  1443.   free(vdata);  
  1444. #endif
  1445. }  /* do_ppolylineset3data */
  1446.  
  1447. /*------------------------------------------------------------------------*/
  1448.  
  1449. static void do_pquadmesh3data()
  1450. {
  1451. #ifdef SUN
  1452.   Pint fflag, vflag, colour_model, numfacets, i;
  1453.   Pint_size dim;
  1454.   Pfacet_data_arr3 fdata;
  1455.   Pfacet_vdata_arr3 vdata;
  1456.  
  1457.   fflag = readinteger("facet data flag ? ");
  1458.   vflag = readinteger("vertex data flag ? ");
  1459.   colour_model = readinteger("colour model ? ");
  1460.   dim.size_x = readinteger("number of vertices along the x-axis ? ");
  1461.   dim.size_y = readinteger("number of vertices along the y-axis ? ");
  1462.   numfacets = (dim.size_x) * (dim.size_y);
  1463.   readfacetdataarr3(fflag, colour_model, numfacets, &fdata);
  1464.   readfacetvdataarr3(vflag, colour_model, numfacets, &vdata);
  1465.   pquad_mesh3_data(fflag, vflag, colour_model, &dim, &fdata, &vdata);
  1466.   switch (fflag)
  1467.   {
  1468.     case PFACET_NONE:
  1469.       break;
  1470.  
  1471.     case PFACET_COLOUR:
  1472.       free(fdata.colrs);
  1473.       break;
  1474.  
  1475.     case PFACET_NORMAL:
  1476.       free(fdata.norms);
  1477.       break;
  1478.  
  1479.     case PFACET_COLOUR_NORMAL:
  1480.       free(fdata.conorms);
  1481.       break;
  1482.   }
  1483.   switch (vflag)
  1484.   {
  1485.     case PVERT_COORD:
  1486.       free(vdata.points);
  1487.       break;
  1488.  
  1489.     case PVERT_COORD_COLOUR:
  1490.       free(vdata.ptcolrs);
  1491.       break;
  1492.  
  1493.     case PVERT_COORD_NORMAL:
  1494.       free(vdata.ptnorms);
  1495.       break;
  1496.  
  1497.     case PVERT_COORD_COLOUR_NORMAL:
  1498.       free(vdata.ptconorms);
  1499.       break;
  1500.   }
  1501. #endif
  1502. }  /* do_pquadmesh3data */
  1503.  
  1504. /*------------------------------------------------------------------------*/
  1505.  
  1506. static void do_pquadmeshdata()
  1507. {
  1508. #ifdef SUN
  1509.   phintererror(1, (char *)NULL, INFORM);
  1510. #endif
  1511. }  /* do_pquadmeshdata */
  1512.  
  1513. /*------------------------------------------------------------------------*/
  1514.  
  1515. static void do_psetbackdatamapind()
  1516. {
  1517. #ifdef SUN
  1518.   phintererror(1, (char *)NULL, INFORM);
  1519. #endif
  1520. }  /* do_psetbackdatamapind */
  1521.  
  1522. /*------------------------------------------------------------------------*/
  1523.  
  1524. static void do_psetbackdatamapmeth()
  1525. {
  1526. #ifdef SUN
  1527.   phintererror(1, (char *)NULL, INFORM);
  1528. #endif
  1529. }  /* do_psetbackdatamapmeth */
  1530.  
  1531. /*------------------------------------------------------------------------*/
  1532.  
  1533. static void do_psetbackintcolr()
  1534. {
  1535. #ifdef SUN
  1536.   Pgcolr colour;
  1537.  
  1538.   readgcolr(&colour, "back interior colour");
  1539.   pset_back_int_colr(&colour);
  1540. #endif
  1541. }  /* do_psetbackintcolr */
  1542.  
  1543. /*------------------------------------------------------------------------*/
  1544.  
  1545. static void do_psetbackintind()
  1546. {
  1547. #ifdef SUN
  1548.   phintererror(1, (char *)NULL, INFORM);
  1549. #endif
  1550. }  /* do_psetbackintind */
  1551.  
  1552. /*------------------------------------------------------------------------*/
  1553.  
  1554. static void do_psetbackintshadmeth()
  1555. {
  1556. #ifdef SUN
  1557.   pset_back_int_shad_meth(readinteger("back shading method ? "));
  1558. #endif
  1559. }  /* do_psetbackintshadmeth */
  1560.  
  1561. /*------------------------------------------------------------------------*/
  1562.  
  1563. static void do_psetbackintstyle()
  1564. {
  1565. #ifdef SUN
  1566.   Pint_style style;
  1567.  
  1568.   style = readphigsenum(PTKEINTERSTYLE, "back interior style ? ");
  1569.   pset_back_int_style(style);
  1570. #endif
  1571. }  /* do_psetbackintstyle */
  1572.  
  1573. /*------------------------------------------------------------------------*/
  1574.  
  1575. static void do_psetbackintstyleind()
  1576. {
  1577. #ifdef SUN
  1578.   pset_back_int_style_ind(readinteger("back interior style index ? "));
  1579. #endif
  1580. }  /* do_psetbackintstyleind */
  1581.  
  1582. /*------------------------------------------------------------------------*/
  1583.  
  1584. static void do_psetbackreflind()
  1585. {
  1586. #ifdef SUN
  1587.   phintererror(1, (char *)NULL, INFORM);
  1588. #endif
  1589. }  /* do_psetbackreflind */
  1590.  
  1591. /*------------------------------------------------------------------------*/
  1592.  
  1593. static void do_psetbackreflmodel()
  1594. {
  1595. #ifdef SUN
  1596.   pset_back_refl_eqn(readinteger("back reflectance model ? "));
  1597. #endif
  1598. }  /* do_psetbackreflmodel */
  1599.  
  1600. /*------------------------------------------------------------------------*/
  1601.  
  1602. static void do_psetbackreflprops()
  1603. {
  1604. #ifdef SUN
  1605.   Prefl_props props;
  1606.  
  1607.   readreflprops(&props, "back reflectance properties ? ");
  1608.   pset_back_refl_props(&props);
  1609. #endif
  1610. }  /* do_psetbackreflprops */
  1611.  
  1612. /*------------------------------------------------------------------------*/
  1613.  
  1614. static void do_psetcolrmapind()
  1615. {
  1616. #ifdef SUN
  1617.   pset_colr_map_ind(readinteger("colour mapping index ? "));
  1618. #endif
  1619. }  /* do_psetcolrmapind */
  1620.  
  1621. /*------------------------------------------------------------------------*/
  1622.  
  1623. static void do_psetcolrmaprep()
  1624. {
  1625. #ifdef SUN
  1626.   Pint ws, index, map_method, i;
  1627.   Pcolr_map_data map_data;
  1628.  
  1629.   ws = readinteger("workstation identifier ? ");
  1630.   index = readinteger("colour mapping index ? ");
  1631.   map_method = readinteger("mapping method ? ");
  1632.   readcolrmapdata(map_method, &map_data, "colour map");
  1633.   pset_colr_map_rep(ws, index, map_method, &map_data);
  1634.   switch (map_method)
  1635.   {
  1636.     case PCOLR_MAP_TRUE:
  1637.       break;
  1638.  
  1639.     case PCOLR_MAP_PSEUDO:
  1640.       free(map_data.meth_r2.weights.floats);
  1641.       free(map_data.meth_r2.colrs);
  1642.       break;
  1643.  
  1644.     case PCOLR_MAP_PSEUDO_N:
  1645.       free(map_data.meth_r3.colr_lists.lists);
  1646.       for (i = 0; i < map_data.meth_r3.colr_lists.num_lists; i++)
  1647.         free(map_data.meth_r3.colr_lists.lists[i].floats);
  1648.       break;
  1649.   } 
  1650. #endif
  1651. }  /* do_psetcolrmaprep */
  1652.  
  1653. /*------------------------------------------------------------------------*/
  1654.  
  1655. static void do_psetcurvapprox()
  1656. {
  1657. #ifdef SUN
  1658.   Pint type;
  1659.   Pfloat value;
  1660.  
  1661.   type = readinteger("curve approx type ? ");
  1662.   value = readreal("curve approx value ? ");
  1663.   pset_curve_approx(type, value);
  1664. #endif
  1665. }  /* do_psetcurvapprox */
  1666.  
  1667. /*------------------------------------------------------------------------*/
  1668.  
  1669. static void do_psetdatamapind()
  1670. {
  1671. #ifdef SUN
  1672.   phintererror(1, (char *)NULL, INFORM);
  1673. #endif
  1674. }  /* do_psetdatamapind */
  1675.  
  1676. /*------------------------------------------------------------------------*/
  1677.  
  1678. static void do_psetdatamapmeth()
  1679. {
  1680. #ifdef SUN
  1681.   phintererror(1, (char *)NULL, INFORM);
  1682. #endif
  1683. }  /* do_psetdatamapmeth */
  1684.  
  1685. /*------------------------------------------------------------------------*/
  1686.  
  1687. static void do_psetdatamaprep()
  1688. {
  1689. #ifdef SUN
  1690.   phintererror(1, (char *)NULL, INFORM);
  1691. #endif
  1692. }  /* do_psetdatamaprep */
  1693.  
  1694. /*------------------------------------------------------------------------*/
  1695.  
  1696. static void do_psetdcueind()
  1697. {
  1698. #ifdef SUN
  1699.   pset_dcue_ind(readinteger("depth cue index ? "));
  1700. #endif
  1701. }  /* do_psetdcueind */
  1702.  
  1703. /*------------------------------------------------------------------------*/
  1704.  
  1705. static void do_psetdcuerep()
  1706. {
  1707. #ifdef SUN
  1708.   Pint ws, index;
  1709.   Pdcue_bundle rep;
  1710.  
  1711.   ws = readinteger("workstation identifier ? ");
  1712.   index = readinteger("depth cue index ? ");
  1713.   readdcuebundle(&rep);
  1714.   pset_dcue_rep(ws, index, &rep);
  1715. #endif
  1716. }  /* do_psetdcuerep */
  1717.  
  1718. /*------------------------------------------------------------------------*/
  1719.  
  1720. static void do_psetedgecolr()
  1721. {
  1722. #ifdef SUN
  1723.   Pgcolr colour;
  1724.  
  1725.   readgcolr(&colour, "edge colour");
  1726.   pset_edge_colr(&colour);
  1727. #endif
  1728. }  /* do_psetedgecolr */
  1729.  
  1730. /*------------------------------------------------------------------------*/
  1731.  
  1732. static void do_psetedgerepplus()
  1733. {
  1734. #ifdef SUN
  1735.   Pint ws, index;
  1736.   Pedge_bundle_plus rep;
  1737.  
  1738.   ws = readinteger("workstation identifier ? ");
  1739.   index = readinteger("edge bundle index ? ");
  1740.   readedgebundleplus(&rep);
  1741.   pset_edge_rep_plus(ws, index, &rep);
  1742. #endif
  1743. }  /* do_psetedgerepplus */
  1744.  
  1745. /*------------------------------------------------------------------------*/
  1746.  
  1747. static void do_psetfacecullmode()
  1748. {
  1749. #ifdef SUN
  1750.   Pcull_mode mode;
  1751.  
  1752.   mode = readphigsenum(PTKECULLMODE, "face culling mode ? ");
  1753.   pset_face_cull_mode(mode);
  1754. #endif
  1755. }  /* do_psetfacecullmode */
  1756.  
  1757. /*------------------------------------------------------------------------*/
  1758.  
  1759. static void do_psetfacedistingmode()
  1760. {
  1761. #ifdef SUN
  1762.   Pdisting_mode mode;
  1763.  
  1764.   mode = readphigsenum(PTKEDISTINGMODE, "face distinguishing mode ? ");
  1765.   pset_face_disting_mode(mode);
  1766. #endif
  1767. }  /* do_psetfacedistingmode */
  1768.  
  1769. /*------------------------------------------------------------------------*/
  1770.  
  1771. static void do_psetintcolr()
  1772. {
  1773. #ifdef SUN
  1774.   Pgcolr colour;
  1775.  
  1776.   readgcolr(&colour, "interior colour ? ");
  1777.   pset_int_colr(&colour);
  1778. #endif
  1779. }  /* do_psetintcolr */
  1780.  
  1781. /*------------------------------------------------------------------------*/
  1782.  
  1783. static void do_psetintrepplus()
  1784. {
  1785. #ifdef SUN
  1786.   Pint wsid, index;
  1787.   Pint_bundle_plus rep;
  1788.  
  1789.   wsid = readinteger("workstation identifier ? ");
  1790.   index = readinteger("interior index ? ");
  1791.   readinterbundleplus(&rep);
  1792.   pset_int_rep_plus(wsid, index, &rep);
  1793. #endif
  1794. }  /* do_psetintrepplus */
  1795.  
  1796. /*------------------------------------------------------------------------*/
  1797.  
  1798. static void do_psetintshadmeth()
  1799. {
  1800. #ifdef SUN
  1801.   pset_int_shad_meth(readinteger("interior shading method ? "));
  1802. #endif
  1803. }  /* do_psetintshadmeth */
  1804.  
  1805. /*------------------------------------------------------------------------*/
  1806.  
  1807. static void do_psetlightsrcrep()
  1808. {
  1809. #ifdef SUN
  1810.   Pint ws, index;
  1811.   Plight_src_bundle rep;
  1812.  
  1813.   ws = readinteger("workstation identifier ? ");
  1814.   index = readinteger("light index ? ");
  1815.   readlightsrcbundle(&rep);
  1816.   pset_light_src_rep(ws, index, &rep);
  1817. #endif
  1818. }  /* do_psetlightsrcrep */
  1819.  
  1820. /*------------------------------------------------------------------------*/
  1821.  
  1822. static void do_psetlightsrcstate()
  1823. {
  1824. #ifdef SUN
  1825.   Pint_list activation, deactivation;
  1826.  
  1827.   readintlst(&activation, "activation list", PTKENOTABLE);
  1828.   readintlst(&deactivation, "deactivation list", PTKENOTABLE);
  1829.   pset_light_src_state(&activation, &deactivation);
  1830.   free(activation.ints);
  1831.   free(deactivation.ints);
  1832. #endif
  1833. }  /* do_psetlightsrcstate */
  1834.  
  1835. /*------------------------------------------------------------------------*/
  1836.  
  1837. static void do_psetoffillareasetdata()
  1838. {
  1839. #ifdef SUN
  1840.   phintererror(1, (char *)NULL, INFORM);
  1841. #endif
  1842. }  /* do_psetoffillareasetdata */
  1843.  
  1844. /*------------------------------------------------------------------------*/
  1845.  
  1846. static void do_psetoffillareaset3data()
  1847. {
  1848. #ifdef SUN
  1849.   Pint fflag, eflag, vflag, colour_model, num_sets, i, j;
  1850.   Pfacet_data_arr3 fdata;
  1851.   Pedge_data_list_list *edata;
  1852.   Pfacet_vdata_list3 *vdata;
  1853.   Pint_list_list *vlist;
  1854.   char prom[80];
  1855.  
  1856.   fflag = readinteger("facet data flag ? ");
  1857.   eflag = readinteger("edge data flag ? ");
  1858.   vflag = readinteger("vertex data flag ? ");
  1859.   colour_model = readinteger("colour model ? ");
  1860.   num_sets = readinteger("number of fill area sets ? ");
  1861.   readfacetdataarr3(fflag, colour_model, num_sets, &fdata);
  1862.   if (eflag == PEDGE_VISIBILITY)
  1863.   {
  1864.     edata = (Pedge_data_list_list *)calloc(num_sets, 
  1865.              sizeof(Pedge_data_list_list));
  1866.     for (i = 0; i < num_sets; i++)
  1867.     {
  1868.       sprintf(prom, "edge data list [%d]", i);
  1869.       readedgedatalistlist(prom, &edata[i]);
  1870.     }
  1871.   }
  1872.   vlist = (Pint_list_list *)calloc(num_sets, sizeof(Pint_list_list));
  1873.   for (i = 0; i < num_sets; i++)
  1874.   {
  1875.     sprintf(prom, "facet [%d], number of index lists ? ", i);
  1876.     vlist[i].num_lists = readinteger(prom);
  1877.     vlist[i].lists = (Pint_list *)calloc(vlist[i].num_lists, 
  1878.                                          sizeof(Pint_list));
  1879.     for (j = 0; j < vlist[i].num_lists; j++)
  1880.     {
  1881.       sprintf(prom, "facet [%d], index list [%d]", i, j);
  1882.       readintlst(&vlist[i].lists[j], prom, PTKENOTABLE);
  1883.     }
  1884.   }
  1885.   vdata = (Pfacet_vdata_list3 *)calloc(num_sets, sizeof(Pfacet_vdata_list3));
  1886.   for (i = 0; i < num_sets; i++)
  1887.     readfacetvdatalist3(vflag, colour_model, i, &vdata[i]);
  1888.   pset_of_fill_area_set3_data(fflag, eflag, vflag, colour_model,
  1889.     num_sets, &fdata, edata, vlist, vdata);
  1890.   for (i = 0; i < num_sets; i++)
  1891.   {
  1892.     switch (vflag)
  1893.     {
  1894.       case PVERT_COORD:
  1895.         free(vdata[i].vertex_data.points);
  1896.         break;
  1897.  
  1898.       case PVERT_COORD_COLOUR:
  1899.         free(vdata[i].vertex_data.ptcolrs);
  1900.         break;
  1901.  
  1902.       case PVERT_COORD_NORMAL:
  1903.         free(vdata[i].vertex_data.ptnorms);
  1904.         break;
  1905.  
  1906.       case PVERT_COORD_COLOUR_NORMAL:
  1907.         free(vdata[i].vertex_data.ptconorms);
  1908.         break;
  1909.     }
  1910.     if (eflag == PEDGE_VISIBILITY)
  1911.       for (j = 0; j < edata[i].num_lists; j++)
  1912.         free(edata[i].edgelist[j].edgedata.edges);
  1913.     for (j = 0; j < vlist[i].num_lists; j++)
  1914.       free(vlist[i].lists[j].ints);    
  1915.   }
  1916.   free(vdata);  
  1917.   free(edata);
  1918.   free(vlist);
  1919.   switch (fflag)
  1920.   {
  1921.     case PFACET_NONE:
  1922.       break;
  1923.  
  1924.     case PFACET_COLOUR:
  1925.       free(fdata.colrs);
  1926.       break;
  1927.  
  1928.     case PFACET_NORMAL:
  1929.       free(fdata.norms);
  1930.       break;
  1931.  
  1932.     case PFACET_COLOUR_NORMAL:
  1933.       free(fdata.conorms);
  1934.       break;
  1935.   } 
  1936. #endif
  1937. }  /* do_psetoffillareaset3data */
  1938.  
  1939. /*------------------------------------------------------------------------*/
  1940.  
  1941. static void do_psetparamsurfcharacs()
  1942. {
  1943. #ifdef SUN
  1944.   Pint psc_type;
  1945.   Ppara_surf_characs data;
  1946.  
  1947.   psc_type = readinteger("parameteric surface characteristic type ? ");
  1948.   readparasurfcharacs(psc_type, &data);
  1949.   pset_para_surf_characs(psc_type, &data);
  1950.   switch (psc_type)
  1951.   {
  1952.     case PSC_NONE:
  1953.       break;
  1954.  
  1955.     case PSC_WS_DEP:
  1956.       break;
  1957.  
  1958.     case PSC_ISOPARAMETRIC_CURVES:
  1959.       break;
  1960.  
  1961.     case PSC_LEVEL_CURVES_MC:
  1962.       free(data.psc_4.params.floats);
  1963.       break;
  1964.  
  1965.     case PSC_LEVEL_CURVES_WC:
  1966.       free(data.psc_5.params.floats);
  1967.       break;
  1968.   }
  1969. #endif
  1970. }  /* do_psetparamsurfcharacs */
  1971.  
  1972. /*------------------------------------------------------------------------*/
  1973.  
  1974. static void do_psetparamsurfind()
  1975. {
  1976. #ifdef SUN
  1977.   phintererror(1, (char *)NULL, INFORM);
  1978. #endif
  1979. }  /* do_psetparamsurfind */
  1980.  
  1981. /*------------------------------------------------------------------------*/
  1982.  
  1983. static void do_psetparamsurfrep()
  1984. {
  1985. #ifdef SUN
  1986.   phintererror(1, (char *)NULL, INFORM);
  1987. #endif
  1988. }  /* do_psetparamsurfrep */
  1989.  
  1990. /*------------------------------------------------------------------------*/
  1991.  
  1992. static void do_psetpatrepplus()
  1993. {
  1994. #ifdef SUN
  1995.   Pint ws, index;
  1996.   Ppat_rep_plus rep;
  1997.  
  1998.   ws = readinteger("workstation identifier ? ");
  1999.   index = readinteger("pattern index ? ");
  2000.   readpatrepplus(&rep);
  2001.   pset_pat_rep_plus(ws, index, &rep);
  2002. #endif
  2003. }  /* do_psetpatrepplus */
  2004.  
  2005. /*------------------------------------------------------------------------*/
  2006.  
  2007. static void do_psetlinecolr()
  2008. {
  2009. #ifdef SUN
  2010.   Pgcolr colour;
  2011.  
  2012.   readgcolr(&colour, "line colour");
  2013.   pset_line_colr(&colour);
  2014. #endif
  2015. }  /* do_psetlinecolr */
  2016.  
  2017. /*------------------------------------------------------------------------*/
  2018.  
  2019. static void do_psetlinerepplus()
  2020. {
  2021. #ifdef SUN
  2022.   Pint ws, index;
  2023.   Pline_bundle_plus rep;
  2024.  
  2025.   ws = readinteger("workstation identifier ? ");
  2026.   index = readinteger("line index ? ");
  2027.   readlinebundleplus(&rep);
  2028.   pset_line_rep_plus(ws, index, &rep);
  2029. #endif
  2030. }  /* do_psetlinerepplus */
  2031.  
  2032. /*------------------------------------------------------------------------*/
  2033.  
  2034. static void do_psetlineshadmeth()
  2035. {
  2036. #ifdef SUN
  2037.   pset_line_shad_meth(readinteger("line shading method ? "));
  2038. #endif
  2039. }  /* do_psetlineshadmeth */
  2040.  
  2041. /*------------------------------------------------------------------------*/
  2042.  
  2043. static void do_psetmarkercolr()
  2044. {
  2045. #ifdef SUN
  2046.   Pgcolr colour;
  2047.  
  2048.   readgcolr(&colour, "line colour");
  2049.   pset_marker_colr(&colour);
  2050. #endif
  2051. }  /* do_psetmarkercolr */
  2052.  
  2053. /*------------------------------------------------------------------------*/
  2054.  
  2055. static void do_psetmarkerrepplus()
  2056. {
  2057. #ifdef SUN
  2058.   Pint ws, index;
  2059.   Pmarker_bundle_plus rep;
  2060.  
  2061.   ws = readinteger("workstation identifier ? ");
  2062.   index = readinteger("marker index ? ");
  2063.   readmarkerbundleplus(&rep);
  2064.   pset_marker_rep_plus(ws, index, &rep);
  2065. #endif
  2066. }  /* do_psetmarkerrepplus */
  2067.  
  2068. /*------------------------------------------------------------------------*/
  2069.  
  2070. static void do_psetreflind()
  2071. {
  2072. #ifdef SUN
  2073.   phintererror(1, (char *)NULL, INFORM);
  2074. #endif
  2075. }  /* do_psetreflind */
  2076.  
  2077. /*------------------------------------------------------------------------*/
  2078.  
  2079. static void do_psetreflmodel()
  2080. {
  2081. #ifdef SUN
  2082.   pset_refl_eqn(readinteger("reflectance model ? "));
  2083. #endif
  2084. }  /* do_psetreflmodel */
  2085.  
  2086. /*------------------------------------------------------------------------*/
  2087.  
  2088. static void do_psetreflprops()
  2089. {
  2090. #ifdef SUN
  2091.   Prefl_props props;
  2092.  
  2093.   readreflprops(&props, "reflectance properties");
  2094.   pset_refl_props(&props);
  2095. #endif
  2096. }  /* do_psetreflprops */
  2097.  
  2098. /*------------------------------------------------------------------------*/
  2099.  
  2100. static void do_psetreflrep()
  2101. {
  2102. #ifdef SUN
  2103.   phintererror(1, (char *)NULL, INFORM);
  2104. #endif
  2105. }  /* do_psetreflrep */
  2106.  
  2107. /*------------------------------------------------------------------------*/
  2108.  
  2109. static void do_psetrenderingcolrmodel()
  2110. {
  2111. #ifdef SUN
  2112.   pset_rendering_colr_model(readinteger("rendering colour model ? "));
  2113. #endif
  2114. }  /* do_psetrenderingcolrmodel */
  2115.  
  2116. /*------------------------------------------------------------------------*/
  2117.  
  2118. static void do_psetsurfapprox()
  2119. {
  2120. #ifdef SUN
  2121.   Pint type;
  2122.   Pfloat uvalue, vvalue;
  2123.  
  2124.   type = readinteger("surface approx type ? ");
  2125.   uvalue = readreal("surface approx value for u dimension ? ");
  2126.   vvalue = readreal("surface approx value for v dimension ? ");
  2127.   pset_surf_approx(type, uvalue, vvalue);
  2128. #endif
  2129. }  /* do_psetsurfapprox */
  2130.  
  2131. /*------------------------------------------------------------------------*/
  2132.  
  2133. static void do_psettextcolr()
  2134. {
  2135. #ifdef SUN
  2136.   Pgcolr colour;
  2137.  
  2138.   readgcolr(&colour, "text colour");
  2139.   pset_text_colr(&colour);
  2140. #endif
  2141. }  /* do_psettextcolr */
  2142.  
  2143. /*------------------------------------------------------------------------*/
  2144.  
  2145. static void do_psettextrepplus()
  2146. {
  2147. #ifdef SUN
  2148.   Pint ws, index;
  2149.   Ptext_bundle_plus rep;
  2150.  
  2151.   ws = readinteger("workstation identifier ? ");
  2152.   index = readinteger("text index ? ");
  2153.   readtextbundleplus(&rep);
  2154.   pset_text_rep_plus(ws, index, &rep);
  2155. #endif
  2156. }  /* do_psettextrepplus */
  2157.  
  2158. /*------------------------------------------------------------------------*/
  2159.  
  2160. static void do_ptrisetdata()
  2161. {
  2162. #ifdef SUN
  2163.   phintererror(1, (char *)NULL, INFORM);
  2164. #endif
  2165. }  /* do_ptrisetdata */
  2166.  
  2167. /*------------------------------------------------------------------------*/
  2168.  
  2169. static void do_ptriset3data()
  2170. {
  2171. #ifdef SUN
  2172.   phintererror(1, (char *)NULL, INFORM);
  2173. #endif
  2174. }  /* do_ptriset3data */
  2175.  
  2176. /*------------------------------------------------------------------------*/
  2177.  
  2178. static void do_ptristripdata()
  2179. {
  2180. #ifdef SUN
  2181.   phintererror(1, (char *)NULL, INFORM);
  2182. #endif
  2183. }  /* do_ptristripdata */
  2184.  
  2185. /*------------------------------------------------------------------------*/
  2186.  
  2187. static void do_ptristrip3dat()
  2188. {
  2189. #ifdef SUN
  2190.   Pint fflag, vflag, colour_model, nv;
  2191.   Pfacet_data_arr3  fdata;
  2192.   Pfacet_vdata_arr3 vdata;
  2193.  
  2194.   fflag = readinteger("facet data flag ? ");
  2195.   vflag = readinteger("vertex data flag ? ");
  2196.   colour_model = readinteger("colour model ? ");
  2197.   nv = readinteger("number of vertices ? ");
  2198.   readfacetdataarr3(fflag, colour_model, nv, &fdata);
  2199.   readfacetvdataarr3(vflag, colour_model, nv, &vdata);
  2200.   ptri_strip3_data(fflag, vflag, colour_model, nv, &fdata, &vdata);
  2201.   switch (fflag)
  2202.   {
  2203.     case PFACET_NONE:
  2204.       break;
  2205.  
  2206.     case PFACET_COLOUR:
  2207.       free(fdata.colrs);
  2208.       break;
  2209.  
  2210.     case PFACET_NORMAL:
  2211.       free(fdata.norms);
  2212.       break;
  2213.  
  2214.     case PFACET_COLOUR_NORMAL:
  2215.       free(fdata.conorms);
  2216.       break;
  2217.   }
  2218.   switch (vflag)
  2219.   {
  2220.     case PVERT_COORD:
  2221.       free(vdata.points);
  2222.       break;
  2223.  
  2224.     case PVERT_COORD_COLOUR:
  2225.       free(vdata.ptcolrs);
  2226.       break;
  2227.  
  2228.     case PVERT_COORD_NORMAL:
  2229.       free(vdata.ptnorms);
  2230.       break;
  2231.  
  2232.     case PVERT_COORD_COLOUR_NORMAL:
  2233.       free(vdata.ptconorms);
  2234.       break;
  2235.   }
  2236. #endif
  2237. }  /* do_ptristrip3dat */
  2238.  
  2239. /*------------------------------------------------------------------------*/
  2240.